function addEvents(obj,sEv,fn){
    if(obj.addEventListener){
        obj.addEventListener(sEv,fn,false);
    }else {
        obj.attachEvent('on'+sEv,fn);
    }
}

function rem(){
    document.documentElement.style.fontSize = document.documentElement.clientWidth*40/1024+'px';
}

rem();
addEvents(window,'resize',rem);

function noticeUp(obj,top,time) {
    $(obj).animate({
        marginTop: top
    }, time, function () {
        $(this).css({marginTop:"0"}).find(":first").appendTo(this);
    })
}